<?php
namespace app\modules\admin\forms\printMachine;

use app\common\forms\BaseForm;

class PrintForm extends BaseForm {

    public $print_id;
    public $type;
    public $sn;
    public $count;
    public $status;

    public function scenarios()
    {
        return [
            'create'=>[
                'type','sn','status','count'
            ],
            'update'=>[
                'print_id','type','sn','status','count'
            ],
        ];
    }

    public function rules()
    {
        return [
            ['print_id','required','on'=>['update'],'message'=>\Yii::t("app","ID不能为空")],
            ['type','integer','skipOnEmpty'=>false,'on'=>['create','update'],'message'=>\Yii::t("app","类型错误")],
            ['sn','required','on'=>['create','update'],'message'=>\Yii::t("app","SN号不能为空")],
            ['count','integer','skipOnEmpty'=>false,'on'=>['create','update'],'message'=>\Yii::t("app","数量错误")],
            ['status','integer','skipOnEmpty'=>false,'on'=>['create','update'],'message'=>\Yii::t("app","状态错误")],
        ];
    }

}